//热门话题添加图片
var img = [ "url('../images/dynamic_01.png')",
            "url('../images/dynamic_02.webp')",
            "url('../images/dynamic_03.webp')",
            "url('../images/dynamic_04.webp')",
            "url('../images/dynamic_05.webp')"
]
for(var i=0;i<img.length;i++){
    $('.hot-topic_img li').eq(i).css('background',img[i]);
}


var dynamic_list = [{
    title:'央视新闻',
    date:'20小时前',
    writer:'【海军首艘万吨驱逐舰南昌舰入列！】今天，南昌舰归建入列仪式在山东青岛某军港码头举行。这是2020年中国海军入列的首艘舰艇，也是中国海军首艘万吨大驱加入战斗序列。南昌舰我国自主研制的055型万吨级驱逐舰首舰，它的入列，标志着海军驱逐舰实现由第三代向第四代的跨越。祝贺(*`ェ´*)   毕竟这个事情于我而言不关乎利益，这是我做人的态度。不欺负别人是教养，不被人欺负是底线。',
    pic:["url('../images/dynamic2_01.jpg')",
        "url('../images/dynamic2_02.jpg')",
        "url('../images/dynamic2_03.jpg')",
        "url('../images/dynamic2_04.jpg')",
        "url('../images/dynamic2_05.jpg')"
        ],
    up:"url('../images/dynamic2_up.jpg')",
    s1:' '+190,
    s2:' '+935,
    s3:' '+15067
    },{
    title:'花花与三猫CatLive',
    date:'昨天11:01',
    writer:'下午好！都干嘛呢？波波茶：麻麻太讨厌了，总是抓拍我出糗的模样～哈哈哈！大佬肚皮亮了(*`ェ´*)   毕竟这个事情于我而言不关乎利益，这是我做人的态度。不欺负别人是教养，不被人欺负是底线。',
    pic:["url('../images/dynamic3_01.jpg')",
        "url('../images/dynamic3_02.jpg')"
        ],
    up:"url('../images/dynamic3_up.jpg')",
    s1:' '+36,
    s2:' '+1139,
    s3:' '+20583
    },{
    title:'CatLive',
    date:'昨天11:01',
    writer:'毕竟这个事情于我而言不关乎利益，这是我做人的态度。不欺负别人是教养，不被人欺负是底线。',
    pic:["url('../images/dynamic3_01.jpg')",
        "url('../images/dynamic3_02.jpg')",
        "url('../images/dynamic2_04.jpg')",
        "url('../images/dynamic2_05.jpg')",
        "url('../images/dynamic2_01.jpg')",
        "url('../images/dynamic2_02.jpg')",
        "url('../images/dynamic2_03.jpg')",
        "url('../images/dynamic2_04.jpg')",
        "url('../images/dynamic2_05.jpg')"
        ],
    up:"url('../images/dynamic_up01.webp')",
    s1:' '+36,
    s2:' '+1139,
    s3:' '+20583
        }
]
// console.log(dynamic_list.length)
// 追加内容
for(var i=0;i<dynamic_list.length;i++){
    var tag = $('.hot-dynamic>li').eq(0).clone(true);
    if(i==0)
        $('.hot-dynamic').html('');
    tag.children('.hot-dynamic_top').children('p').html('<a href="#">'+dynamic_list[i].title+'</a><br><span>'+dynamic_list[i].date+'</span>');
    tag.children('.hot-dynamic_top').children('.up_img').css('background',dynamic_list[i].up);
    tag.children('.dynamic_content').children('.writer').html(dynamic_list[i].writer);
    tag.children('.dynamic_content').children('.operate').children('span').eq(0).html(dynamic_list[i].s1);
    tag.children('.dynamic_content').children('.operate').children('span').eq(1).html(dynamic_list[i].s2);
    tag.children('.dynamic_content').children('.operate').children('span').eq(2).html(dynamic_list[i].s3);
    for(var j=0;j<dynamic_list[i].pic.length;j++){
        // var new_li = $('.dynamic_content_img li').eq(0).clone(true);
        var new_li = tag.children('.dynamic_content').children('ul').children('li').eq(0).clone(true);
        if(j==0)
            tag.children('.dynamic_content').children('.dynamic_content_img').html('');
        new_li.css('background',dynamic_list[i].pic[j]);
        tag.children('.dynamic_content').children('.dynamic_content_img').append(new_li);
    }
    $('.hot-dynamic').append(tag);
}
//点击圆点显示举报    .css('color','#009FD3');
$('.icon-yuandian').click(function(){
    $(this).parent().parent().children('div').children('.report').toggle();
})
// console.log($('.icon-yuandian').eq(0));
//头像
$('.up_add_bg').eq(0).addClass('sh_up_add2');
$('.up_add_bg').eq(1).addClass('sh_up_add');
$('.up_add_bg').eq(2).addClass('sh_up_add1');


//点击图片方法缩小
// var flag = false;
// $('.dynamic_content_img').click(function(){
//     if(flag==true){
//         $(this).css({'width':'509px','height':'680px','background':"url('../images/dynamic1_01_amp.jpg')",'cursor':'zoom-out'})
//     }
//     if(flag==false){
//         $(this).css({'width':'104px','height':'104px','background':"url('../images/dynamic1_01.jpg')",'cursor':'zoom-in'})
//     }
//     flag=!flag;
// })


